import random
from pypinyin import pinyin, Style

class GenEmail:

    def __init__(self):

        self.__email_suffix = ["@163.com", "@126.com", "@qq.com"]
        self.__email = None

    def generate_pinyin(self, name):
        name_tmp = pinyin(name, style=Style.NORMAL)
        name_list = []
        for i in name_tmp:
            name_list.append(i[0])
        name_pinyin = ''.join(name_list)
        return name_pinyin
    
    def get_random_email_suffix(self):
        return random.choice(self.__email_suffix)

    def generate_data(self):
        # name = GenName().generate_data()
        # name_pinyin = self.generate_pinyin(name["name"])
        name = random.randint(100000, 999999)
        self.__email = str(name) + self.get_random_email_suffix()
        return self.__email

if __name__ == "__main__":
    email = GenEmail().generate_data()
    print(email)